-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic support for .heic files #519
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and sorry about the delay. The PR looks good but it will need a rebase. Also would be great if you can add a test and test image (with an open source license).
if hasattr(img, "_getexif") and callable(img._getexif): | ||
exif = img._getexif() | ||
elif "exif" in img.info: | ||
exif = img.getexif()._get_merged_dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
img._getexif()
is an alias for img.getexif()._get_merged_dict()
so we can probably switch to the public methods, which I think are supported since a long time ? (Our min version of pillow is 8.0 currently)
@@ -264,7 +264,7 @@ def exif(self): | |||
datetime_format = self.settings["datetime_format"] | |||
return ( | |||
get_exif_tags(self.raw_exif, datetime_format=datetime_format) | |||
if self.raw_exif and self.src_ext in (".jpg", ".jpeg") | |||
if self.raw_exif and self.src_ext in (".jpg", ".jpeg", ".heic") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extension list here and below should also include ".heif" I guess ?
Also, those extensions should be recognized only if pillow-heif is available, so might be better to store this list somewhere where it can be imported (in the image
module ?) and reused.
No description provided.